//
//  HSYImageScrollview.m
//  高仿暴走斗图
//
//  Created by key on 16/4/29.
//  Copyright © 2016年 huangsongyao. All rights reserved.
//

#import "HSYImageScrollview.h"
#import "UIScrollView+Page.h"
#import "UIView+Gesture.h"

#define OFFSET_LEFT         20.0f
#define CANCEL_IMG_SIZE     10.0f

@interface HSYImageScrollview ()<UIScrollViewDelegate>

@property (nonatomic, strong) UIScrollView *scrollView;
@property (nonatomic, strong) UIButton *cancelButton;

@end

@implementation HSYImageScrollview

- (instancetype)init {
    
    if (self = [super init]) {
        
        [self setup];
    }
    return self;
}

- (instancetype)initWithFrame:(CGRect)frame {
    
    if (self = [super initWithFrame:frame]) {
        
        [self setup];
    }
    return self;
}


- (void)setup {
    
    _images = [[NSMutableArray alloc] init];
    self.scrollView = [NSObject createScrollViewWithContentOffset:CGPointMake(0, 0)
                                                  withContentSize:CGSizeMake(self.images.count *(self.viewWidth + OFFSET_LEFT), 0)
                                                 canPagingEnabled:NO
                                                 canScrollEnabled:YES
                                                       canBounces:YES
                                                         delegate:self];
    self.scrollView.frame = self.bounds;
    [self addSubview:self.scrollView];
    
    
    for (NSInteger i = 0; i < self.images.count; i++) {
        
//        UIImage *image = self.images[i];
        
    }
//    @weakify(self);
//    [self addGestureRecognizer:[UIView rac_AddTapGestureRecognizerWithNumberOfTouchesRequired:1 numberOfTapsRequired:1 andTargetBlock:^(UITapGestureRecognizer *x) {
//     
//        @strongify(self);
//        CGPoint touch = [x locationInView:self];
//        if (touch.x) {
//
//        }
//    }]];
}

- (void)setImages:(NSMutableArray *)images {
    
    _images = images;
    
}
@end
